﻿app.factory('AdminFactory', ['$http', '$q', function ($http, $q) {
    var o = {};
    o.Projects = [];

    var getAllProjects = function () {
        var config = { contentType: 'application/json' };
        $http.get('/api/apiAdmin', config).success(function (data) {
            o.Projects.length = 0;
            for (var i = 0; i < data.length; i++) {
                o.Projects[i] = data[i];
            }
        });
    };
    getAllProjects();

    return o;
}]);